package com.service.atmjk;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.bpms.common.CommonUtil;
import com.bpms.common.JdbcWorker;
import com.bpms.common.VO;
import com.bpms.esb.IService;

public class Updateatmdevice implements IService {
	public VO exec(VO arg0) {
		JdbcWorker j = null;
		VO vo = new VO();
		try {			
			j = new JdbcWorker();		
			Date temp = new Date();
			
			vo.setAttr("DEVICENO", arg0.getAttr("DEVICENO")); // 设备号
			vo.setAttr("NETNUM", arg0.getAttr("NETNUM")); // 网点号
			vo.setAttr("REGISTRATIONDATE", new SimpleDateFormat("yyyy-MM-dd hh:MM:ss").format(temp)); // 创建日期
			//vo.setAttr("REGISTRANT", arg0.getAttr("REGISTRANT")); //创建人
			vo.setAttr("DEVICENAME", arg0.getAttr("DEVICENAME")); //设备名称
			vo.setAttr("ATMIPADDRESS", arg0.getAttr("ATMIPADDRESS")); //ip地址
			vo.setAttr("VIRTUALCNUM", arg0.getAttr("VIRTUALCNUM")); // 虚拟柜员
					
			VO k = new VO();
			k.voType = "ATMDEVICE";
			k.keyString="DEVICENO";
			k.setAttr("DEVICENO", arg0.getAttr("DEVICENO"));
			
			j.update(vo, k);
			vo.setAttr("ret", "0000");
			vo.setAttr("msg", "修改成功");
		} catch (Exception e) {
			CommonUtil.debug("Getcontract exception", e);
			vo.setAttr("ret", "9999");
			vo.setAttr("msg", "修改失败");
		}
		return vo;
	}

}
